import request from '@/utils/request'

// 查询优惠券规则列表
export function listCouponrule(query) {
  return request({
    url: '/couponrule/couponrule/list',
    method: 'get',
    params: query
  })
}

// 查询优惠券规则详细
export function getCouponrule(payId) {
  return request({
    url: '/couponrule/couponrule/' + payId,
    method: 'get'
  })
}

// 新增优惠券规则
export function addCouponrule(data) {
  return request({
    url: '/couponrule/couponrule',
    method: 'post',
    data: data
  })
}

// 修改优惠券规则
export function updateCouponrule(data) {
  return request({
    url: '/couponrule/couponrule',
    method: 'put',
    data: data
  })
}

// 删除优惠券规则
export function delCouponrule(payId) {
  return request({
    url: '/couponrule/couponrule/' + payId,
    method: 'delete'
  })
}
